package com.niit.service;

import com.niit.entity.Student;
import com.niit.mapper.StudentMapper;
import com.niit.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

public class StudentService {

    public int insertStudent(Student student) {
        SqlSession sqlSession = MybatisUtil.getSqlSession();
        StudentMapper studentMapper = sqlSession.getMapper(StudentMapper.class);
        int result = studentMapper.insertStudent(student);
        sqlSession.commit();
        sqlSession.close();
        return result;
    }
}
